package com.aqiang.day0528_shop.main.presenter

import com.aqiang.day0528_shop.main.contract.AreaContract
import com.aqiang.day0528_shop.main.model.AreaModel

class AreaPresenter(v:AreaContract.AreaView) : AreaContract.AreaPresenter(v) {
    override fun getArea3(id: Int) {
        if(mView != null && mView.get() != null){
            val area = mModel.getArea2(id)
            mView.get()!!.area(area)
        }
    }

    override fun getArea1(id: Int) {
        if(mView != null && mView.get() != null){
            val area = mModel.getArea1(id)
            mView.get()!!.area(area)
        }
    }

    override fun getArea(id: Int) {
        if(mView != null && mView.get() != null){
            val area = mModel.getArea(id)
            mView.get()!!.area(area)
        }
    }

    override fun initModel(): AreaContract.AreaModel {
        return AreaModel()
    }
}